<%--
  Created by IntelliJ IDEA.
  User: sjj
  Date: 2015/10/24 0024
  Time: 19:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>中奖用户管理</title>

    <!-- 新 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="/css/bootstrap.min.css">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>
<div class="container">
    <h1>中奖用户管理</h1>   <a href="/deleteAllWinUser" type="button" class="btn btn-sm btn-warning">删除所有中奖者</a>
    <hr/>

    <%--  <h3>所有用户 <a href="/addUser" type="button" class="btn btn-default btn-sm">添加</a></h3>--%>

    <%--  <!-- 如果用户列表为空 -->
      <c:if test="${empty prizeList}">
        <p class="bg-warning">
          <br/>
             表为空，请<a href="/addUser" type="button" class="btn btn-default btn-sm">添加</a>
          <br/>
          <br/>
        </p>
      </c:if>--%>

    <!-- 如果用户列表非空 -->
    <c:if test="${!empty winUserList}">
        <table class="table table-bordered table-striped">
            <tr>
                <th>姓名</th>
                <th>地址</th>
                <th>电话</th>
                <th>奖品</th>
                <th>是否领取</th>
            </tr>

            <c:forEach items="${winUserList}" var="winuser">
                <tr>
                    <td>${winuser.name}</td>
                    <td>${winuser.address}</td>
                    <td>${winuser.phonenumber}</td>
                    <td>${winuser.prizename}</td>
                    <td>
                        <c:if test="${winuser.isgetprize ==0}">
                            <a href="/updateWinUser/${winuser.id}" type="button" class="btn btn-sm btn-warning">未领取</a>
                        </c:if>
                        <c:if test="${winuser.isgetprize ==1}">
                            <a href="/updateWinUser/${winuser.id}" type="button" class="btn btn-sm btn-warning">已领取</a>
                        </c:if>
                    </td>
                </tr>
            </c:forEach>
        </table>
    </c:if>
</div>

<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="/js/jquery.min.js"></script>

<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="/js/bootstrap.min.js"></script>
</body>
</html>
